#region Apache License
//
// Licensed to the Apache Software Foundation (ASF) under one or more 
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership. 
// The ASF licenses this file to you under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with 
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion

using System;
using System.Collections.Generic;
using System.Text;

using IPSim.Core;

namespace IPSim.Data
{
    public class EthernetFrame
    {
        private readonly MacAddress m_destAddress;
        private readonly MacAddress m_srcAddress;
        private readonly IEthernetData m_data;
        private readonly EtherTypes m_etherType;

        public EthernetFrame(IEthernetData data, MacAddress destAddress, MacAddress srcAddress, EtherTypes etherType)
        {
            m_data = data;
            m_destAddress = destAddress;
            m_srcAddress = srcAddress;
            m_etherType = etherType;
        }

        public MacAddress DestAddress
        {
            get
            {
                return m_destAddress;
            }
        }

        public MacAddress SrcAddress
        {
            get
            {
                return m_srcAddress;
            }
        }

        public EtherTypes EtherType
        {
            get 
            {
                return m_etherType;
            }
        }

        public IEthernetData Data
        {
            get
            {
                return m_data;
            }
        }

        public enum EtherTypes : ushort
        {
            IPv4 = 0x0800,
            IPv6 = 0x86DD,
            ARP  = 0x0806,
            RARP = 0x8035,
        }
    }
}
